﻿<UserControl x:Class="MusicExplorer.View.Log"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:controls="clr-namespace:MusicExplorer.Resources.Control"
             xmlns:internals="clr-namespace:MusicExplorer.Internals"
             >

    <UserControl.Resources>
        <ResourceDictionary>
            <internals:LogTypeToVisibilityImageConverter x:Key="LogTypeToVisibilityImageConverter" />
            <internals:LogTypeToVisibilityLoadingImageConverter x:Key="LogTypeToVisibilityLoadingImageConverter" />
            <internals:LogTypeToImageConverter x:Key="LogTypeToImageConverter" />
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Skins/LogSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <!-- Loading -->
    <Border BorderThickness="0, 1, 0, 0" Style="{StaticResource BorderColorStyle}">
        <Grid HorizontalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Image Source="{Binding LogType, Converter={StaticResource LogTypeToImageConverter}}" Width="16" Height="16" VerticalAlignment="Center"
                        Visibility="{Binding LogType, Converter={StaticResource LogTypeToVisibilityImageConverter}}"/>
            <controls:LoadingTreeviewIndicator VerticalAlignment="Center"
                                                   Visibility="{Binding LogType, Converter={StaticResource LogTypeToVisibilityLoadingImageConverter}}" />
            <TextBlock Text="{Binding CurrentLog}" Grid.Column="1" Margin="10, 0, 0, 0" VerticalAlignment="Center" />
        </Grid>
    </Border>
    
</UserControl>
